package com.buddha.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2023-07-06
 */
@Getter
@Setter
  @TableName("menu")
@ApiModel(value = "Menu对象", description = "")
public class Menu implements Serializable {

    private static final long serialVersionUID = 1L;

      @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      @ApiModelProperty("父级菜单id")
      private Integer parentId;

      @ApiModelProperty("菜单名称")
      private String name;

      @ApiModelProperty("菜单路径")
      private String path;

      @ApiModelProperty("权限")
      private String perms;

      @ApiModelProperty("组件名称")
      private String component;

      @ApiModelProperty("类型：0（目录），1（菜单），2（按钮）")
      private String type;

      @ApiModelProperty("菜单图标")
      private String icon;

      @ApiModelProperty("排序号")
      private Integer orderNum;

      @ApiModelProperty("创建时间")
      private LocalDateTime created;

      @ApiModelProperty("上次更新时间")
      private LocalDateTime updated;

      @ApiModelProperty("状态：0（禁用），1（正常）")
      private Integer state;
  @TableField(exist = false)
  private List<Menu> children = new ArrayList<>();
}
